
const excelParser = require('excel').default;
// import mongoose from 'mongoose'
import { writeFileSync } from 'fs'

excelParser('./terms.xlsx').then((data) => {
  const newdata = []
  data.forEach((value, index) => {
    newdata.push({
      problem: value[0],
      problem_id: index + 1, // 做题id
      problem_tip: value[1]
    })
  })
  writeFileSync('./terms.json', JSON.stringify(newdata, null, 2), 'utf-8')
});

